﻿using Dapper.Extensions;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json;
using Ymatou.ServiceCenter.Common;
using Ymatou.ServiceCenter.Domain;
using Ymatou.ServiceCenter.Domain.IRepositories;
using Ymatou.ServiceCenter.Domain.Models;
using Ymatou.ServiceCenter.Services;

namespace Ymatou.ServiceCenter.UnitTest
{
    [TestClass]
    public class ServiceTest
    {
        [TestMethod]
        public void Test1()
        {
            IList<ServiceDependencySampling>  list = new List<ServiceDependencySampling>();
            for(int i=0;i<5;i++)
            {
                ServiceDependencySampling sampling= new ServiceDependencySampling();
                sampling.Id = Math.Abs(Guid.NewGuid().GetHashCode());
                sampling.BeginTime = DateTime.Now.AddHours(-1).AddMinutes(i);
                sampling.EndTime= DateTime.Now;
                sampling.ConsumerAppId = "c1";
                sampling.ProviderAppId = "p1";
                sampling.ApiPath = "p1path1";
                sampling.ApiName = "p1" + i;
               list.Add(sampling);
            }

            string json = JsonConvert.SerializeObject(list);
            ServiceHub.ServiceMetadataService.Test();
        }
    }
}
